package com.cfets.annualAssessment.backgroundController;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Optional;

/**
 * Created by liusonglin on 2016/11/14.
 */
@Controller
@RequestMapping("/admin")
public class LoginController {

    @RequestMapping("/login")
    public String login(@RequestParam(required = false) String error, Model model){
        if (error!=null) {
            model.addAttribute("error", error);
        }
        return "login";
    }

    @RequestMapping("/home/index")
    public String home(Model model){
        return "home";
    }
}
